import 'package:shared_preferences/shared_preferences.dart';

enum PUBLISHING_ENVIRONMENT { DEV, TEST, PROD }

class InitConfig {
  static var ENV;
  static String BASE_API_HOST = "";
  static String BASE_WS_URL = "";


//  todo baseURL 发布环境
  static const String _DEV_API_HOST = "https://houtai.zhidudu.cn/api/zltonline/";
  static const String _TEST_API_HOST = "";
  static const String _PROD_API_HOST = "https://houtai.zhidudu.cn/api/zltonline/";
  static const String _DEV_WS_URL = "wss://wss.zhidudu.cn/wss";
  static const String _TEST_WS_URL = "";
  static const String _PROD_WS_URL = "wss://wss.zhidudu.cn/wss";
  static SharedPreferences sPrefs;

  static Future initApp() async {
    sPrefs = await SharedPreferences.getInstance();
//    TODO 修改发布环境
    ENV = PUBLISHING_ENVIRONMENT.TEST;

    switch (ENV) {
      case PUBLISHING_ENVIRONMENT.DEV:
        BASE_API_HOST = _DEV_API_HOST;
        BASE_WS_URL = _DEV_WS_URL;
        break;
      case PUBLISHING_ENVIRONMENT.TEST:
        BASE_API_HOST = _TEST_API_HOST;
        BASE_WS_URL = _TEST_WS_URL;
        break;
      case PUBLISHING_ENVIRONMENT.PROD:
        BASE_API_HOST = _PROD_API_HOST;
        BASE_WS_URL = _PROD_WS_URL;
        break;
    }
  }
}
